package org.wii.base.exception.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.wii.base.annotation.ExceptionModule;
import org.wii.base.exception.constant.ExceptionModuleConstant;
import org.wii.base.exception.constant.ExceptionTypeEnum;
import org.wii.base.exception.constant.IExceptionErrCode;

/**
 * 用户请求异常基础
 * @author tanghong on 2022/12/23
 */
@AllArgsConstructor
@Getter
@ExceptionModule(type = ExceptionTypeEnum.USER, code = ExceptionModuleConstant.VALIDATE_ARG)
public enum UserRequestBaseExceptionEnum implements IExceptionErrCode {
    /**缺失请求参数*/
    MISSING_REQUEST_PARAMETER_EXCEPTION(1, "请求参数缺失异常, %s %s!"),
    /**请求数据经过httpMessageConverter出错*/
    HTTP_MESSAGE_CONVERTER_ERROR(2, "请求格式转化问题"),
    /**不受支持的媒体类型*/
    HTTP_MEDIA_TYPE_NOT_SUPPORT(3, "请求的http media type不合法"),
    /**不受支持的http请求方法*/
    HTTP_METHOD_NOT_SUPPORT(4, "当前接口不支持 %s 方式请求"),
    /**404找不到资源*/
    NOT_FOUND(5, "404：找不到请求的资源"),
    VALIDATE_ARG_ERR(6, "校验结果错误!"),
    NOT_LOGIN(7, "用户未登录"),
    ;

    private long code;
    private String message;
}
